package com.dlc.shop.user.platform.controller;

import com.dlc.shop.bean.model.Delivery;
import com.dlc.shop.common.response.ServerResponseEntity;
import com.dlc.shop.service.DeliveryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author lgh on 2018/11/26.
 */
@Tag(name = "积分物流信息")
@RestController
@RequestMapping("/score/delivery")
@AllArgsConstructor
public class ScoreDeliveryController {

    private final DeliveryService deliveryService;

    @GetMapping("/list")
    @Operation(summary = "获取物流公司列表" , description = "获取物流公司列表")
    @PreAuthorize("@pms.hasPermission('user:scoreDelivery:list')")
    public ServerResponseEntity<List<Delivery>> list(){
        List<Delivery> list = deliveryService.list();
        return ServerResponseEntity.success(list);
    }

}
